import java.util.Arrays;
import java.util.Scanner;
class MyValue{
    public int val;
}
public class Test {


    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        String a = in.nextLine();

        //正则表达式判断输入合法性
        if(!a.matches("^[0-9]*$")) {
            System.out.print("Wrong Format");
            return;
        }

        if(a.length()%8!=0) {
            System.out.print("Wrong Format");
            return;
        }

        int start,out = 0;
        for(start = 0;start<a.length();start+=8) {
            if(a.substring(start,start+6).equals("202017")||
                    a.substring(start,start+6).equals("202061")) {
                if(out == 1){
                    System.out.print(" ");
                }
                System.out.print(a.substring(start+4,start+8));
                out = 1;
            }
        }
    }



    public  static void swap(MyValue value1,MyValue value2){
        int tmp=0;
        tmp=value1.val;
        value1.val=value2.val;
        value2.val=tmp;
    }
    public static void main2(String[] args) {
        MyValue value1=new MyValue();
        value1.val=10;
        MyValue value2=new MyValue();
        value2.val=20;
        System.out.println("交换前"+"value1="+value1.val+" "+"value2="+value2.val);
        swap(value1,value2);
        System.out.println("交换后"+"value1="+value1.val+" "+"value2="+value2.val);

    }

}